using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudParametreDao : BaseEntity
	{
		private readonly string fromHql = " from CloudParametre as t ";
		public void Insert(CloudParametre dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudParametre dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudParametre dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int parametreId)
		{
			CloudParametre dto = new CloudParametre();
			dto.ParametreId = parametreId;
			Delete(dto);
		}

		public CloudParametre Get(int parametreId, LockMode lockMode)
		{
			return Get<CloudParametre>(parametreId, lockMode);
		}

		public List<CloudParametre> FindAll()
		{
			return Find<CloudParametre>(fromHql, LockMode.Read);
		}

		public List<CloudParametre> FindAll(string orderStatement)
		{
			return Find<CloudParametre>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
